﻿<!--#include file="const.inc"-->
<%
'====================================================================
' 感谢使用晴天3G智能建站系统..
' 作者:梁永强.QQ:766750857
' 官方网址:wap.qt3g.com
' 声明:软件版权归作者所有,没有经过作者本人同意不得非法破解和传播本程序
'====================================================================
%>

<%

Set Rs = Server.CreateObject("Adodb.Recordset")


	dim rs,sql,i,infoid,Page,backurl,dat,dat1
	const PageSize=10	'每页10

	infoid=Request.QueryString("infoid")
	if infoid="" then infoid=0
	if not isnumeric(infoid) then infoid=0
	infoid=clng(infoid)

    	Page = Request("page")      '当前页数
    	If Page = "" Then Page = 1
   	If Not IsNumeric(Page) Then Page = 1
    	Page = CLng(Page)
    	If Page < 1 Then Page = 1
		listid=Request.QueryString("listid")
		if not isnumeric(listid) then listid=0
		if listid="" then listid=0
		listid=clng(listid)
		pageid=Request.QueryString("pageid")
		if not isnumeric(pageid) then pageid=1
		if pageid="" then pageid=1
		pageid=clng(pageid)

	backurl=Request.QueryString("backurl")


	

select case v
case "0"
we0="<br/>"
hr="-------------<br/>"
book="<input name=""remark"" type=""text"" maxlength=""128"" emptyok=""true"" size='15' value="""" /><br/><select title='表情' name='face' value='0'><option title='表情' value='0'>表情</option><option title='微笑' value='1'>微笑</option><option title='哭泣' value='2'>哭泣</option><option title='调皮' value='3'>调皮</option><option title='脸红' value='4'>脸红</option><option title='害羞' value='5'>害羞</option><option title='生气' value='6'>生气</option><option title='偷笑' value='7'>偷笑</option><option title='流汗' value='8'>流汗</option><option title='我倒' value='9'>我倒</option><option title='得意' value='10'>得意</option><option title='奸笑' value='11'>奸笑</option><option title='疑问' value='12'>疑问</option><option title='睡觉' value='13'>睡觉</option><option title='好色' value='14'>好色</option><option title='口水' value='15'>口水</option><option title='敲头' value='16'>敲头</option><option title='惊讶' value='17'>惊讶</option><option title='撇嘴' value='18'>撇嘴</option><option title='难过' value='19'>难过</option><option title='玫瑰' value='20'>玫瑰</option></select><anchor title=""发表回复"">发表回复<go href='showcont.asp?Action=save&amp;id="&infoid&"&amp;listid=" & listid & "&amp;pageid=" & pageid & "&amp;sid="&sidd&"' method='post'><postfield name=""content"" value=""$(remark)""/><postfield name=""face"" value=""$(face)""/></go></anchor><br/>"&hr&""
%>
<card title="查看回复"><p align="<%=qingtian.px%>">
<%
case "1"
hr=""
zi="<span style=""color:#FF5500"">"
zi0="</span>"
we="<div class=""footer"">"
sou="<div class=""block4"">"
dao="<div class=""navi"">"
we0="</div>"
book="<form action=""showcont.asp?Action=save&amp;id="&infoid&"&amp;listid=" & listid & "&amp;pageid=" & pageid & "&amp;sid="&sidd&""" method=""post""><br/><input type=""text"" name=""content"" size='15' value="""" /><br/><select title='表情' name='face' value='0'><option title='表情' value='0'>表情</option><option title='微笑' value='1'>微笑</option><option title='哭泣' value='2'>哭泣</option><option title='调皮' value='3'>调皮</option><option title='脸红' value='4'>脸红</option><option title='害羞' value='5'>害羞</option><option title='生气' value='6'>生气</option><option title='偷笑' value='7'>偷笑</option><option title='流汗' value='8'>流汗</option><option title='我倒' value='9'>我倒</option><option title='得意' value='10'>得意</option><option title='奸笑' value='11'>奸笑</option><option title='疑问' value='12'>疑问</option><option title='睡觉' value='13'>睡觉</option><option title='好色' value='14'>好色</option><option title='口水' value='15'>口水</option><option title='敲头' value='16'>敲头</option><option title='惊讶' value='17'>惊讶</option><option title='撇嘴' value='18'>撇嘴</option><option title='难过' value='19'>难过</option><option title='玫瑰' value='20'>玫瑰</option></select><input type=""submit"" value=""发表回复"" /></form><br/>"
%>
<title>查看回复</title>
</head>
<body>
<!--#include virtual="/css.inc"-->
<%

End Select

%>

<%
	
		if sid="Null" then
		%><%=dao%><%=zi%>欢迎你<%=zi0%><a href="/login.asp?sid=<%=sidd%>&amp;url=/bbs/showboard.asp?infoid=<%=infoid%>@@backurl=<%=Replace(backurl,"@@","@*@")%>">注册/登陆</a><%=we0%><%
		else
		qingtian.info
		end if


		%><%=qingtian.qingsav("47")%>
		<%=book%>
		<%
     		Sql = "select a.id,a.content,a.time,a.nid,a.upfile,a.top,b.name,b.vip from [qingtian_bbs_reforum] a,[qingtian_user] b where a.nid=b.id and a.del=0 and  a.topicid="&infoid&" order by a.top asc,a.id desc"
		Rs.Open Sql,conn,1,1

		if not (rs.bof and rs.eof)  then

				Rs.PageSize = 15	'一页N条记录
				IF Not IsEmpty(Page) Then
					IF Not IsNumeric(Page) Then		'判断Page是否为数字
						Page=1
					Else
						Page=Cint(Page)		'转换成短整形Integer
					End IF
					IF Page > Rs.PageCount Then
						Rs.AbsolutePage = Rs.PageCount	'设置当前显示页等于最后一页
					ElseIF Page <= 0 Then
						Rs.AbsolutePage = 1		'设置当前页等于第一页
					Else
						Rs.AbsolutePage = Page	'如果大于零,显示当前页等于接收的
					End IF
				Else
					Rs.AbsolutePage = 1
				End IF
				Page = Rs.AbsolutePage


		For i=1 to  Rs.PageSize
		If Rs.Eof Then
			exit For
		End If
			if  qingtian.bz(listid) then
dim shanc
shanc="<br/><a href=""banji.asp?Act=rep&amp;reid="&rs("id")&"&amp;id="&infoid&"&amp;listid="&listid&"&amp;pageid="&pageid&"&amp;sid="&sidd&""">编辑</a>.<a href=""upa.asp?action=rep&amp;id="&infoid&"&amp;listid="&listid&"&amp;reid="&rs("id")&"&amp;pageid="&pageid&"&amp;sid="&sidd&""">上传</a>.<a href=""guan.asp?Action=delrep&amp;id="&infoid&"&amp;listid="&listid&"&amp;reid="&rs("id")&"&amp;pageid="&pageid&"&amp;sid="&sidd&""">删除</a>"
elseif  rs("nid")=qingtian.nid  then
shanc="<br/><a href=""banji.asp?Act=rep&amp;reid="&rs("id")&"&amp;id="&infoid&"&amp;listid="&listid&"&amp;pageid="&pageid&"&amp;sid="&sidd&""">编辑</a>.<a href=""upa.asp?action=rep&amp;id="&infoid&"&amp;listid="&listid&"&amp;reid="&rs("id")&"&amp;pageid="&pageid&"&amp;sid="&sidd&""">上传</a>"
end if
dat=rs.RecordCount-(page-1)*15-i+1
         Response.Write we
                If RS("top") = True Then
                    Response.Write (""&zi&"<b>[顶]</b>"&zi0&"")
                if  qingtian.bz(listid) or conn.Execute("select nid from qingtian_bbs_forum where id="&infoid&"")("nid")=qingtian.nid then
                shanb=".<a href=""guan.asp?Action=qudrep&amp;id="&infoid&"&amp;listid="&listid&"&amp;reid="&rs("id")&"&amp;pageid="&pageid&"&amp;sid="&sidd&""">取顶</a>"
                end if
                ELSE
                if  qingtian.bz(listid) or conn.Execute("select nid from qingtian_bbs_forum where id="&infoid&"")("nid")=qingtian.nid then
                shanb=".<a href=""guan.asp?Action=dinrep&amp;id="&infoid&"&amp;listid="&listid&"&amp;reid="&rs("id")&"&amp;pageid="&pageid&"&amp;sid="&sidd&""">置顶</a>"
                end if
                    Response.Write (""&zi&"["&dat&"楼]."&zi0&"")                    
                End If
%>
<%=qingtian.ubb(rs("content"))%>
<%

		if rs("upfile")=true then
if sid="Null" then
Response.Write("<br/>此资源需<a href='/login.asp?sid="&sidd&"&amp;url=/bbs/board.asp?listid=" & listid & "'>登录</a>查看<br/>")
else
Response.Write("<br/>")
			Set file_rs = Server.CreateObject("Adodb.Recordset")
			Sql = "select top 1 [id],[name],[url],[size],[time],[nid] from [qingtian_bbs_reforum_file] a  where topicid="&infoid&" and reid="&rs("id")&" order by [id] desc"
			file_rs.Open Sql,conn,1,1
			if not (file_rs.bof and file_rs.eof)  then
			FileExp=Right(qingtian.utf8(file_rs("url")),Len(qingtian.utf8(file_rs("url")))-InstrRev(qingtian.utf8(file_rs("url")),"."))
                        FileExpe=Right(qingtian.utf8(file_rs("url")),Len(qingtian.utf8(file_rs("url")))-InstrRev(qingtian.utf8(file_rs("url")),"/"))
			if lcase(FileExp)="gif" or lcase(FileExp)="jpg" or lcase(FileExp)="bmp" or lcase(FileExp)="png" or lcase(FileExp)="jpeg" then
				%>
            <img src="<%=qingtian.utf8(file_rs("url"))%>" alt='附件'/><br/>
            <%
			end if
			if len(file_rs("name"))>0 then%><%=qingtian.utf8(file_rs("name"))%><br/><%end if%><a href="<%=qingtian.utf8(file_rs("url"))%>">下载<%=qingtian.utf8(FileExpe)%></a><br/>
            <%
			
                        end if
			file_rs.close
			set file_rs=nothing
end if
		end if
%>(<%=rs("time")%>)<%=we0%><%=sou%>作者:<a href="/user/spacev.Asp?nid=<%=rs("nid")%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rs("name"))%> 
<%
if rs("vip")=1 then
Response.Write "<img src=""/img/vip.gif"" alt='VIP' noselect = ""true"" />"
end if
%>
(ID:<%=rs("nid")%>)</a>.[<a href="/user/liaoinfo.Asp?urls=/bbs/showboard.asp?infoid=<%=infoid%>@@listid=<%=listid%>&amp;id=<%=rs("nid")%>&amp;sid=<%=sidd%>">对话</a>]<%=shanc%><%=shanb%><%=we0%><%
shanc=""
shanb=""
		Rs.MoveNext
		next
%>
<%=hr%>
<%
                if rs.PageCount>1 then
                    Response.Write dao
                end if
   		'分页
    		If Page < rs.PageCount Then
    		    Response.Write("<a href='showboard.asp?infoid="&infoid&"&amp;listid=" & listid & "&amp;pageid=" & pageid & "&amp;page=" & Page + 1 & "&amp;sid="&sidd&"'>下一页</a>")
    		End If
       
    		If Page > 1 And Page < rs.PageCount Then
    		    Response.Write("|")
    		End If
        
    		If Page > 1 Then
    		    Response.Write("<a href='showboard.asp?infoid="&infoid&"&amp;page=" & Page - 1 & "&amp;listid=" & listid & "&amp;pageid=" & pageid & "&amp;sid="&sidd&"'>上一页</a>"&we0&"")
    		Elseif rs.PageCount >1 then
    		    Response.Write(""&we0&"")
    		End If
            
    		Randomize()
    
    		If rs.PageCount > 100 Then
    		    Response.Write("<input name='Page' format='*N' size='5' maxlength='5'/>")
    		    Response.Write("<a href='showboard.asp?infoid="&infoid&"&amp;page=$(Page:n)&amp;listid=" & listid & "&amp;pageid=" & pageid & "&amp;sid="&sidd&"'>跳页</a>"&we0&"")
    		End If
                                                                
    		Response.Write("" & we & "(第" & Page & "/总" & rs.PageCount & "页/共" & rs.RecordCount & "条)"&we0&"")

		else
			%><%=sou%>暂无回复<%=we0%><%
		end if
		Rs.close


			
	set rs=nothing

		%><%=qingtian.qingsav("48")%><%=sou%><a href="viewv.asp?id=<%=infoid%>&amp;listid=<%=listid%>&amp;sid=<%=sidd%>">返回上级</a><%=we0%>

<%

End Function
%>
